package com.gf.pf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gf.pf.mapper.DictionaryMapper;
import com.gf.pf.model.Dictionary;
import com.gf.pf.model.Ztree;
import com.gf.pf.service.DictionaryService;

/**
 * @describe 基本信息-字典信息
 * @author   WLxing
 * @date     2015年3月10日
 */
@Service
@Transactional
public class DictionaryServiceImpl implements DictionaryService {
	
	@Autowired
	private DictionaryMapper dictionaryMapper;
	
	/* (non-Javadoc)
	 * @see com.gf.pf.service.DictionaryService#findDic(java.lang.Long)
	 * 根据字典ID查询字典信息
	 */
	@Override
	public Dictionary getDic(String dicId) {
		return dictionaryMapper.getDic(dicId);
	}

	/* (non-Javadoc)
	 * @see com.gf.pf.service.DictionaryService#getDictionaryZtree(java.lang.String)
	 * 根据ID查询根目录下的字典字段
	 */
	@Override
	public List<Ztree> getDictionaryZtree() {
		return dictionaryMapper.getDictionaryZtree();
	}

	/* (non-Javadoc)
	 * @see com.gf.pf.service.DictionaryService#saveDic(com.gf.pf.model.Dictionary)
	 * 保存字典信息
	 */
	@Override
	public Integer saveDic(Dictionary dic) {
		return dictionaryMapper.saveDic(dic);
	}

	/* (non-Javadoc)
	 * @see com.gf.pf.service.DictionaryService#modifyDic(com.gf.pf.model.Dictionary)
	 * 字典信息修改
	 */
	@Override
	public Integer modifyDic(Dictionary dic) {
		return dictionaryMapper.modifyDic(dic);
	}

	/* (non-Javadoc)
	 * @see com.gf.pf.service.vService#deleteDic(java.lang.String)
	 * 字典信息删除
	 */
	@Override
	public Integer deleteDic(String dicId) {
		return dictionaryMapper.deleteDic(dicId);
	}

}
